package org.bmind.datasword.config.dto;

import java.util.ArrayList;
import java.util.Collection;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.bmind.datasword.utils.EqualsUtil;
import org.bmind.datasword.utils.HashCodeUtil;
import org.bmind.datasword.utils.StorageUtilities;
@XmlRootElement
public class DMonoAnalisys extends DObjIdentity {
	static { StorageUtilities.addREngineType(DMonoAnalisys.class); }
	private int fHashCode;
	
	public DMonoAnalisys() {
		
	}
	
	private Collection<DData> listDData = new ArrayList<DData>();
	private Collection<DPlot> listDPlot = new ArrayList<DPlot>();
	
	/**
	 * @return the listRData
	 */
	public Collection<DData> getListDData() {return listDData;}
	@XmlElement
	public void setListDData(Collection<DData> listDData) {this.listDData = listDData;}
	
	/**
	 * @return the listRPlot
	 */
	public Collection<DPlot> getListDPlot() {return listDPlot;}
	@XmlElement
	public void setListDPlot(Collection<DPlot> listDPlot) {this.listDPlot = listDPlot;}
	
	
	/* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if ( this == obj ) return true;
 	    if ( !(obj instanceof DMonoAnalisys) ) return false;
 	   
 	   DMonoAnalisys dMa = (DMonoAnalisys)obj;
 	    
     	return	EqualsUtil.areEqual(this.listDData, dMa.listDData) &&
     			EqualsUtil.areEqual(this.listDPlot, dMa.listDPlot);
    }

	/* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#hashCode()
     */
	@Override
	public int hashCode() {
		
		// this style of lazy initialization is
		// suitable only if the object is immutable
		if (fHashCode == 0) {
		int result = HashCodeUtil.SEED;
			result = HashCodeUtil.hash(result, listDData);
			result = HashCodeUtil.hash(result, listDPlot);
			fHashCode = result;
		}
		return fHashCode;
	}
	
	
	
	
	}
